﻿using System.Collections.ObjectModel;
using wpf.prism.Models;

namespace wpf.prism.Serivces
{
    /// <summary>
    /// 导航菜单服务 
    /// </summary>
    public class NavigationMenuService : INavigationMenuService
    {
        public NavigationMenuService()
        {
            Items = new ObservableCollection<NavigationItem>();
        }

        private ObservableCollection<NavigationItem> items;

        public ObservableCollection<NavigationItem> Items
        {
            get { return items; }
            set { items = value; }
        }


        /// <summary>
        /// 初始化菜单
        /// </summary>
        public void InitMenus()
        {
            Items.Clear();
            Items.Add(new NavigationItem("", "All", "全部", "", new ObservableCollection<NavigationItem>()
            {
                 new NavigationItem("","TemplateMatch","模板匹配","",new ObservableCollection<NavigationItem>()
                 {
                      new NavigationItem("ShapeOutline","ShapeMatch","形状匹配","DrawShapeView"),
                      new NavigationItem("Clouds","NccMacthss", "相似性匹配ss","ShapeView"),
                      new NavigationItem("Clouds","NccMacth", "相似性匹配","NccView"),
                      new NavigationItem("ShapeOvalPlus","DeformationMatch","形变匹配","LocalDeformableView"),
                 }),
                 new NavigationItem("","Measure", "比较测量","",new ObservableCollection<NavigationItem>()
                 {
                      new NavigationItem("Circle","Caliper","卡尺找圆","CircleMeasureView"),
                 }),
                 new NavigationItem("","Character","字符识别","",new ObservableCollection<NavigationItem>()
                 {
                      new NavigationItem("Barcode","BarCode", "一维码识别","BarCodeView"),
                      new NavigationItem("Qrcode", "QrCode","二维码识别","QrCodeView"),
                 })
            }));
            Items.Add(new NavigationItem("", "Setting", "系统设置", "SettingView"));
        }

        public void RefreshMenus()
        {
            throw new NotImplementedException();
        }
    }
}
